Ignore onFastPath builtin while looking for valid static initializer of a global variable#32319
Conversation
…of a global variable
|
@swift-ci smoke test |
|
@swift-ci smoke test OS X |
|
@swift-ci Please smoke test OS X platform |
|
@swift-ci Please smoke test Linux platform |
eeckstein
left a comment
There was a problem hiding this comment.
You need to handle this builtin also in IRGen's emitConstantValue().
It would make sense to add a run command line with -emit-ir to test/SILOptimizer/optionset.swift, so that this is also tested.
|
@eeckstein I can't seem to write a test where the builtin needs to be handled in IRGen's emitConstantValue. Looks like onFastPath builtin is generated with no users during SILGen, so the static initializer will not have the onFastPath builtin. Additionally, we never seem to call emitConstantValue for an empty type. |
eeckstein
left a comment
There was a problem hiding this comment.
@meg-gupta okay, thanks for checking. If it compiles, then it's fine.
The presence of this builtin has no effect while optimizing initializers of global variables.